docs(server-renderer) fix typo in renderToWebStream
error, and remove Cloudflare Worker reference
#4249
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixing the typo is pretty self explanatory, but the Cloudflare Workers doc change needs a little more explanation:
Unfortunately, Cloudflare Workers does not expose the
ReadableStream
constructor, which means it's not as simple asreturn new Response(renderToWebStream(app))
here.There are ways to get this to work in Cloudflare Workers via ponyfill-ing
ReadableStream
, and then manually writing back to aTransformStream
which is available in their environment, and ends up looking something like this:More discussion can be found in #4243.
I figured that this complexity is very Cloudflare Workers specific, so perhaps wouldn't make sense to include in the README here. However I think it's a good idea to remove the CF Workers reference here, so others aren't confused about this not working in future. If it makes sense, I'd be happy to contribute some docs somewhere (where?) about this, or extend this README if you feel it makes the most sense here. Let me know.